@import './util.scss';
@import './base.scss';

.app {
  height: 100vh;
  background: url('../images/bg.png') no-repeat;
  background-size: 100% 100%;
  padding: 0 vw(54) vw(16) vw(54);
}
$zHeaderHeight: vw(90);
.z-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  height: $zHeaderHeight;
}
.z-header-title {
  width: vw(898);
  height: 100%;
  background: url('../images/header.png') no-repeat;
  background-size: 100% 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  .title {
    font-family: 'zcool-gdh';
    text-align: center;
    font-size: vw(48);
    line-height: vw(55);
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 1) 62%,
      rgba(157, 205, 232, 1) 84%
    );
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 0 vw(6) vw(4) rgba(#000, 0.1);
  }
}

.z-header-left {
  width: vw(200);
  flex: 0 0 auto;
}
.z-header-right {
  width: vw(200);
  flex: 0 0 auto;
  padding: vw(10) vw(10) 0 0;
  display: inline-flex;
  justify-content: flex-end;
}
.z-header-time {
  color: #fff;
  font-size: vw(20);
  line-height: vw(24);
}
.z-header-date {
  color: #fff;
  font-size: vw(12);
  line-height: vw(16);
}
.z-fullscreen-btn {
  display: inline-block;
  width: vw(26);
  height: vw(26);
  background: url('../images/fullscreen-bg.png') no-repeat;
  background-size: 100% 100%;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.3s;
  &:hover {
    transform: scale(1.1);
  }
  i {
    display: inline-block;
    width: 100%;
    height: 100%;
    background-image: url('../images/fullscreen-btn.png');
    background-repeat: no-repeat;
    background-size: 100% 100%;
  }

  &.icon-fullscreen-cancel {
    i {
      background-image: url('../images/fullscreen-cancel.png');
    }
  }
}

.z-main {
  display: flex;
  height: calc(100% - $zHeaderHeight);
}
.z-main-left,
.z-main-right {
  width: vw(400);
  flex: 0 0 auto;
  .z-card {
    position: relative;
    & + .z-card {
      margin-top: vw(16);
    }
  }
}
.z-main-center {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  padding: vw(32) vw(56) vw(16) vw(56);
}

.z-main-statistics {
  height: vw(64 + 8);
  background: url('../images/main-statistics.png') no-repeat,
    url('../images/main-statistics2.png') no-repeat;
  background-size: 100% vw(64), calc(100% - vw(8)) vw(64);
  background-position: center top, center bottom;
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0 0 0 vw(64);
  .statistics-item {
    display: flex;
    align-items: center;
    flex: 1 1 0;
    min-width: 0;
    height: vw(56);
  }
  .statistics-item-icon {
    width: vw(53);
    height: 100%;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    &.icon-statistic1 {
      background-image: url('../images/statistics/1.png');
    }
    &.icon-statistic2 {
      background-image: url('../images/statistics/2.png');
    }
    &.icon-statistic3 {
      background-image: url('../images/statistics/3.png');
    }
    &.icon-statistic4 {
      background-image: url('../images/statistics/4.png');
    }
  }
  .statistics-item-right {
    margin-left: vw(16);
  }
  .statistics-label {
    color: rgba(176, 214, 221, 1);
    font-size: vw(14);
    font-weight: 400;
    line-height: vw(20);
    height: vw(20);
  }
  .statistics-value {
    height: vw(28);
    line-height: 1;
    .value {
      font-family: 'D-DIN-PRO';
      color: rgba(0, 220, 255, 1);
      font-size: vw(24);
      line-height: vw(28);
      display: inline-block;
      vertical-align: middle;
    }
    .unit {
      color: rgba(176, 214, 221, 1);
      font-size: vw(12);
      line-height: vw(28);
      font-weight: 400;
      display: inline-block;
      vertical-align: middle;
    }
  }
}
.z-left-statistics,
.z-right-statistics {
  position: absolute;
  top: vw(156);
}
// 左侧统计
.z-left-statistics {
  left: vw(56);

  .side-statistics-item {
    .title {
      background: url('../images/Label-line-left.png') no-repeat bottom left;
    }
  }
}
// 右侧统计
.z-right-statistics {
  right: vw(56);

  .side-statistics-item {
    .title {
      background: url('../images/Label-line-right.png') no-repeat bottom right;
      text-align: right;
    }
    .value {
      text-align: right;
    }
  }
}

.side-statistics-item {
  .title {
    color: rgba(255, 255, 255, 1);
    font-size: vw(16);
    font-weight: 500;
    line-height: vw(20);
    display: block;
    padding: 0 0 vw(8) 0;
    background-size: vw(103) auto;
  }
  .value {
    font-family: 'D-DIN-PRO';
    font-size: vw(24);
    line-height: vw(28);
    margin-top: vw(12);
    &.is-red {
      color: rgba(255, 122, 122, 1);
    }
    &.is-yellow {
      color: rgba(255, 219, 41, 1);
    }
    &.is-cyan {
      color: rgba(41, 255, 219, 1);
    }
    &.is-blue {
      color: rgba(41, 221, 255, 1);
    }
  }

  & + .side-statistics-item {
    margin-top: vw(36);
  }
}

// tab切换

.z-main-tab {
  position: absolute;
  top: vw(124);
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  border-radius: vw(2);
  background: rgba(0, 68, 116, 1);
  padding: vw(5) vw(7);
  list-style: none;
  margin: 0;
}
.z-main-tab-item {
  display: inline-flex;
  align-items: center;
  height: vw(28);
  border-radius: 1px;
  background: rgba(1, 178, 255, 0.5);
  padding: vw(5);
  user-select: none;
  cursor: pointer;
  .icon {
    width: vw(16);
    height: vw(16);
  }
  .label {
    color: rgba(255, 255, 255, 1);
    font-size: vw(12);
    font-weight: 400;
    line-height: vw(14);
    margin-left: vw(4);
  }
  & + .z-main-tab-item {
    margin-left: vw(5);
  }
  &.is-active {
    background: rgba(1, 178, 255, 1);
  }
}

// 卡片
.z-card {
  border-radius: vw(16);
  background: rgba(61, 109, 178, 0.11);
  .z-card-header {
    height: vw(48);
    display: flex;
    align-items: center;
    padding: 0 vw(16) 0 vw(48);
    background-repeat: no-repeat;
    background-position: left vw(16) bottom;
    background-size: calc(100% - vw(16)) vw(36);
    background-image: url('../images/title.png');
    &.big-bg {
      background-image: url('../images/title2.png');
    }
  }
  .z-card-title {
    color: rgba(255, 247, 229, 1);
    font-size: vw(18);
    font-weight: 500;
    line-height: vw(28);
    text-align: left;
  }
  .z-card-body {
    padding: vw(16);
  }
}

// 待处理告警
.pending-alarm-card {
  position: absolute;
  bottom: vh(40);
  $left: 20;
  left: vw($left);
  width: calc(100% - vw($left * 2));
}

// 表格
table {
  border-spacing: 0;
  border-collapse: collapse;
}

.z-table {
  width: 100%;
  table-layout: fixed;
  th,
  td {
    font-size: vw(12);
    font-weight: 500;
    line-height: vw(16);
    height: vw(36);
    text-align: left;
    padding: vw(2) vw(10);
    &:nth-of-type(1) {
      padding-left: vw(28);
    }
  }
  th {
    color: rgba(205, 224, 255, 1);
  }
  td {
    color: rgba(255, 255, 255, 1);
  }
  thead {
    tr {
      background: rgba(26, 81, 132, 0.2);
    }
  }
  tbody {
    tr {
      &:nth-of-type(2n) {
        background: rgba(26, 81, 132, 0.1);
      }
    }
  }
  .cell {
    @include ellipsis;
  }
}
.z-table-scroll {
  overflow: auto;
  height: vw(36 * 3);
  scroll-behavior: smooth;

  &::-webkit-scrollbar {
    background-color: transparent;
    height: 10px;
    width: 10px;
  }
  &::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
  }
}

// tag
.severity-tag {
  display: inline-block;
  min-width: vw(64);
  height: vw(24);
  padding: vw(2) vw(4);
  color: rgba(255, 255, 255, 1);
  font-size: vw(12);
  font-weight: 500;
  line-height: vw(16);
  text-align: center;
  border: 1px solid rgba(172, 172, 172, 1);
  background: rgba(172, 172, 172, 0.28);
  border-radius: vw(2);
  // 未定义
  &.theme-undefined {
    border-color: rgba(55, 187, 207, 1);
    background: rgba(55, 187, 207, 0.28);
  }
  // 信息
  &.theme-info {
    border-color: rgba(61, 207, 55, 1);
    background: rgba(61, 207, 55, 0.28);
  }
  // 警告
  &.theme-warning {
    border-color: 1px solid rgba(255, 137, 0, 1);
    background: rgba(255, 137, 0, 0.28);
  }
  // 一般
  &.theme-general {
    border-color: rgba(255, 219, 41, 1);
    background: rgba(255, 219, 41, 0.28);
  }
  // 严重
  &.theme-serious {
    border-color: rgba(240, 176, 112, 1);
    background: rgba(240, 176, 112, 0.28);
  }
  // 灾难
  &.theme-disaster {
    border-color: rgba(255, 91, 91, 1);
    background: rgba(255, 91, 91, 0.28);
  }
}

.map-chart {
  height: calc(100% - vw(72));
}
.cy-map {
  height: vw(580);
  width: 80%;
  margin: 0 auto;
}
.chart-top {
  height: vh(210);
}
.chart-center {
  height: vh(296);
}
.chart-bottom {
  height: vh(252);
}
// 图例
@mixin legend {
  position: absolute;
  top: vw(48+8);
  right: vw(24);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: vw(20);
}
.chart-pendingIssueLeft-legend {
  @include legend;
  .legend-icon {
    flex: 0 0 auto;
    width: vw(10);
    height: vw(10);
    border: 1px solid #29b8ff;
    background: linear-gradient(
      to right,
      transparent,
      rgba(41, 221, 255, 0.64)
    );
  }
  .legend-label {
    color: #fff;
    font-size: vw(12);
    margin-left: vw(6);
  }
}
.chart-pendingIssueRight-legend {
  @include legend;
  .legend-icon {
    flex: 0 0 auto;
    width: vw(10);
    height: vw(10);
    background: #29ffdb;
  }
  .legend-label {
    color: #fff;
    font-size: vw(12);
    margin-left: vw(6);
  }
}

.chart-alertTrends-legend {
  @include legend;
  .legend-icon {
    flex: 0 0 auto;
    width: vw(10);
    height: vw(5);
    background: #ffdb29;
  }
  .legend-label {
    color: #fff;
    font-size: vw(12);
    margin-left: vw(6);
  }
}
.chart-severityAlerts-legend {
  @include legend;

  .legend-item {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    & + .legend-item {
      margin-left: vw(14);
    }
  }
  .legend-icon-bar {
    flex: 0 0 auto;
    width: vw(10);
    height: vw(10);
    background: linear-gradient(to bottom, #35e7fd, #095bc4);
  }
  .legend-icon-line {
    flex: 0 0 auto;
    width: vw(10);
    height: vw(5);
    background: #e1c42b;
  }
  .legend-label {
    color: #fff;
    font-size: vw(12);
    margin-left: vw(6);
  }
}

.chart-alarmSeverityClass-legend {
  position: absolute;
  top: vw(48 + 36);
  right: vw(24);
  .legend-item {
    display: flex;
    align-items: center;
    & + .legend-item {
      margin-top: vw(14);
    }
  }
  .legend-icon {
    flex: 0 0 auto;
    width: vw(10);
    height: vw(10);
    &.is-blue {
      background: #34e4fc;
    }
    &.is-green {
      background: #67f5b7;
    }
    &.is-yellow {
      background: #ffb658;
    }
    &.is-white {
      background: #e2f7ff;
    }
  }
  .legend-label,
  .legend-value {
    font-size: vw(14);
    font-weight: 400;
    line-height: vw(18);
    margin-left: vw(12);
  }
  .legend-label {
    flex: 1 1 auto;
    min-width: 0;
    color: rgba(#fff, 0.8);
  }
  .legend-value {
    font-family: 'D-DIN-PRO';
    color: #fff;
  }
}
.chart-hostStatus-legend {
  position: absolute;
  top: vw(48 + 36);
  right: vw(24);
  .legend-item {
    display: flex;
    align-items: center;
    & + .legend-item {
      margin-top: vw(14);
    }
  }
  .legend-icon {
    flex: 0 0 auto;
    width: vw(8);
    height: vw(8);
    border-radius: 50%;
    &.is-blue {
      background: #34e4fc;
    }
    &.is-green {
      background: #67f5b7;
    }
    &.is-yellow {
      background: #ffb658;
    }
    &.is-white {
      background: #e2f7ff;
    }
  }
  .legend-label,
  .legend-value {
    font-size: vw(14);
    font-weight: 400;
    line-height: vw(18);
    margin-left: vw(12);
  }
  .legend-label {
    flex: 1 1 auto;
    min-width: 0;
    color: rgba(#fff, 0.8);
  }
  .legend-value {
    font-family: 'D-DIN-PRO';
    color: #fff;
  }
}
